package com.imooc.controller;

import com.imooc.test.TestClass;
import com.imooc.entity.User;
import com.imooc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.List;

@RestController
public class UserController {

    @Autowired
    UserService userService;

//    @Qualifier //我们在这增加注解
    @Autowired
    List<TestClass> testClassList= Collections.emptyList();

    @GetMapping("/test")
    public List<User> getUsers(){
        return userService.findUsers();
    }


//
//
    @GetMapping("/t1")
    public List test(){
//        System.out.println(testClassList);
        return testClassList;
    }

}
